/**
 * Created by lijtg on 2015/10/21.
 */
$(document).ready(function () {
    var main = {
        config: {
        },
        cache: {
            timer: null
        },
        submit: function (){
            var btn = $('#pr-btn-submit');
            if(btn.attr('disabled') == 'disabled') return;
            $.ajax({
                type: "POST",
                url: common.hostPath + "/req/returnTrade.do",
                data: {
                    result: 'success'
                },
                dataType : 'json',
                success: function (data) {
					window.location.href='http://127.0.0.1:48889/module/customer/return_url.jsp?'+data.result.para;
                },
                complete: function(){
					//console.log('fffffff');
                }
            });
        },
        regHammer: function () {
            var hammer = new Hammer($('#pr-btn-submit')[0]);
            hammer.on('tap', function (ev) {
                main.submit();
            });
        },

        init: function () {
            main.regHammer();
        }
    };

    main.init();
});